package edu.scnu.fans.fingertip.order.output;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class OrderOutput {

    private Long id;

    private Instant created;
    private Instant updated;

    @ApiModelProperty("用户id")
    private Long userId;
    @ApiModelProperty("收件人")
    private String receiver;
    @ApiModelProperty("收件人手机号")
    private String mobile;
    @ApiModelProperty("收件人地址")
    private String address;
    @ApiModelProperty("总价")
    private BigDecimal totalAmount;
    @ApiModelProperty("订单备注")
    private String remark;
    @ApiModelProperty("订单状态 0:未支付; 1:已支付; 2:已发货; 3:已完成; 4:退款")
    private Integer orderStatus;
    @ApiModelProperty("支付时间")
    private LocalDateTime payTime;
    @ApiModelProperty("发货时间")
    private LocalDateTime deliverTime;
    @ApiModelProperty("完成时间")
    private LocalDateTime finishTime;

    @ApiModelProperty("订单商品列表")
    private List<OrderItemOutput> orderItemList;

    public OrderOutput(Long id, Instant created, Instant updated, Long userId, String receiver, String mobile,
                       String address, BigDecimal totalAmount, String remark, Integer orderStatus,
                       LocalDateTime payTime, LocalDateTime deliverTime, LocalDateTime finishTime) {
        this.id = id;
        this.created = created;
        this.updated = updated;
        this.userId = userId;
        this.receiver = receiver;
        this.mobile = mobile;
        this.address = address;
        this.totalAmount = totalAmount;
        this.remark = remark;
        this.orderStatus = orderStatus;
        this.payTime = payTime;
        this.deliverTime = deliverTime;
        this.finishTime = finishTime;
    }
}
